package org.codeart.juc.pool;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class SingleThreadPoolDemo {

    public static void main(String[] args) {
        ExecutorService pool = Executors.newSingleThreadExecutor();
        pool.execute(() -> System.out.println(Thread.currentThread().getName() + "-" + System.currentTimeMillis()));
        pool.execute(() -> System.out.println(Thread.currentThread().getName() + "-" + System.currentTimeMillis()));
        pool.execute(() -> System.out.println(Thread.currentThread().getName() + "-" + System.currentTimeMillis()));
    }

}
